package org.library;

import org.library.config.Config;
import org.library.menu.MainMenu;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author Chen
 */
public class Main {

    public static void main(String[] args) {
        // 创建 Spring 上下文
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class);
        AutowireCapableBeanFactory autowireCapableBeanFactory = context.getAutowireCapableBeanFactory();
        Library library = new Library();
        library.setMenu(autowireCapableBeanFactory.getBean(MainMenu.class));
        library.run();
    }
}